using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Hmw;
using net_work.Data.Entity.Hmw;

namespace net_work.IService.Hmw;

public interface IHomeworkService
{
    /// <summary>
    /// 分页查询作业
    /// </summary>
    /// <param name="request">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<Homework>> GetHomeworksPagedAsync(PagedRequest request);

    /// <summary>
    /// 根据作业ID查询作业信息
    /// </summary>
    /// <param name="homeworkId">作业ID</param>
    /// <returns>作业信息</returns>
    Task<Homework?> SelectByIdAsync(long homeworkId);

    /// <summary>
    /// 插入作业
    /// </summary>
    /// <param name="homeworkAddRequest">新增作业实体</param>
    /// <returns>作业ID</returns>
    Task<long> InsertHomework(HomeworkAddRequest homeworkAddRequest);

    /// <summary>
    /// 更新作业信息
    /// </summary>
    /// <param name="homeworkUpdateRequest">更新作业信息</param>
    /// <returns>是否成功</returns>
    Task<int> UpdateHomework(HomeworkUpdateRequest homeworkUpdateRequest);

    /// <summary>
    /// 删除作业
    /// </summary>
    /// <param name="ids">作业ID集合</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteHomeworkByIds(List<long> ids);

    /// <summary>
    /// 发布作业
    /// </summary>
    /// <param name="homeworkId">作业ID</param>
    /// <returns>是否成功</returns>
    Task<int> Release(long homeworkId);
}